%     AERO LOAD - программа для нагружения агрегатов самолета распределенной нагрузкой
%     Copyright (C) 2018-2024  Михаил Козлов
%     Сайт проекта: <http://www.fastenerdoctor.ru/>
%     Адрес электронной почты для связи с разработчиком:
%     <doctor.fastener@gmail.com>
% 
%     Эта программа является свободным программным обеспечением: Вы можете
%     распространять ее и/или изменять, соблюдая условия Универсальной общественной
%     лицензии GNU, опубликованной Фондом свободного программного обеспечения,
%     либо редакции 3, либо (на Ваше усмотрение) любой редакции, выпущенной позже.
% 
%     Эта программа распространяется в надежде на то, что она окажется полезной,
%     но БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, включая даже подразумеваемую гарантию ТОВАРНОЙ ПРИГОДНОСТИ,
%     либо ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННЫХ ЦЕЛЕЙ. Ознакомьтесь с Универсальной общественной
%     лицензией GNU для получения более подробной информации.
% 
%     Вы должны были получить копию Универсальной общественной лицензии GNU
%     вместе с этой программой. Если Вы ее не получили, то перейдите по адресу:
%     <http://www.gnu.org/licenses/>.
% 
%     This program is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     (at your option) any later version.
% 
%     This program is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%     GNU General Public License for more details.
% 
%     You should have received a copy of the GNU General Public License
%     along with this program.  If not, see <https://www.gnu.org/licenses/>.

function GW_Update_Graphics()

global Graphic_Window_Handle;
global Graphics;

% ================== Геометрия ==================

Draw_Corner_Points_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Corner_Points_Button');
Label_Corner_Points_Button = findall(Graphic_Window_Handle, 'Tag', 'Label_Corner_Points_Button');
Coord_Corner_Points_Button = findall(Graphic_Window_Handle, 'Tag', 'Coord_Corner_Points_Button');

State.Draw_Corner_Points_Button = Draw_Corner_Points_Button.Value;
State.Label_Corner_Points_Button = Label_Corner_Points_Button.Value;
State.Coord_Corner_Points_Button = Coord_Corner_Points_Button.Value;

if (State.Draw_Corner_Points_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Corner_Points_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Corner_Points_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

if (State.Label_Corner_Points_Button == 0)
    
    tmp.Value = 0;
    tmp.Tag = 'Label_Corner_Points_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
end

if (State.Coord_Corner_Points_Button == 1)
    
    tmp.Value = 1;
    tmp.Tag = 'Coord_Corner_Points_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

Draw_Proj_Corner_Points_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Proj_Corner_Points_Button');
Label_Proj_Corner_Points_Button = findall(Graphic_Window_Handle, 'Tag', 'Label_Proj_Corner_Points_Button');
Coord_Proj_Corner_Points_Button = findall(Graphic_Window_Handle, 'Tag', 'Coord_Proj_Corner_Points_Button');

State.Draw_Proj_Corner_Points_Button = Draw_Proj_Corner_Points_Button.Value;
State.Label_Proj_Corner_Points_Button = Label_Proj_Corner_Points_Button.Value;
State.Coord_Proj_Corner_Points_Button = Coord_Proj_Corner_Points_Button.Value;

if (State.Draw_Proj_Corner_Points_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Proj_Corner_Points_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Proj_Corner_Points_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

if (State.Label_Proj_Corner_Points_Button == 0)
    
    tmp.Value = 0;
    tmp.Tag = 'Label_Proj_Corner_Points_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
end

if (State.Coord_Proj_Corner_Points_Button == 1)
    
    tmp.Value = 1;
    tmp.Tag = 'Coord_Proj_Corner_Points_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

Draw_Chord_Surface_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Chord_Surface_Button');
Draw_Chord_Surface_Param_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Chord_Surface_Param_Button');

State.Draw_Chord_Surface_Button = Draw_Chord_Surface_Button.Value;
State.Draw_Chord_Surface_Param_Button = Draw_Chord_Surface_Param_Button.Value;

if (State.Draw_Chord_Surface_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Chord_Surface_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Chord_Surface_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

if (State.Draw_Chord_Surface_Param_Button == 1)
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Chord_Surface_Param_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

Draw_Proj_Chord_Surface_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Proj_Chord_Surface_Button');
Draw_Proj_Chord_Surface_Param_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Proj_Chord_Surface_Param_Button');

State.Draw_Proj_Chord_Surface_Button = Draw_Proj_Chord_Surface_Button.Value;
State.Draw_Proj_Chord_Surface_Param_Button = Draw_Proj_Chord_Surface_Param_Button.Value;

if (State.Draw_Proj_Chord_Surface_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Proj_Chord_Surface_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Proj_Chord_Surface_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

if (State.Draw_Proj_Chord_Surface_Param_Button == 1)
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Proj_Chord_Surface_Param_Button';
    GW_Plot_Erase_Geom(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

% ================== Сетка ==================

Draw_Mesh_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Mesh_Button');
Draw_Normals_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Normals_Button');

State.Draw_Mesh_Button = Draw_Mesh_Button.Value;
State.Draw_Normals_Button = Draw_Normals_Button.Value;

if (State.Draw_Mesh_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Mesh_Button';
    GW_Plot_Erase_Mesh(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Mesh_Button';
    GW_Plot_Erase_Mesh(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

if (State.Draw_Normals_Button == 1)
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Normals_Button';
    GW_Plot_Erase_Mesh(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

Draw_Projected_Mesh_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Projected_Mesh_Button');
Draw_Projected_Normals_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Projected_Normals_Button');

State.Draw_Projected_Mesh_Button = Draw_Projected_Mesh_Button.Value;
State.Draw_Projected_Normals_Button = Draw_Projected_Normals_Button.Value;

if (State.Draw_Projected_Mesh_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Projected_Mesh_Button';
    GW_Plot_Erase_Mesh(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Projected_Mesh_Button';
    GW_Plot_Erase_Mesh(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

if (State.Draw_Projected_Normals_Button == 1)
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Projected_Normals_Button';
    GW_Plot_Erase_Mesh(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

% ================== Диаграммы ==================

Draw_Span_Load_Diag_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Span_Load_Diag_Button');

State.Draw_Span_Load_Diag_Button = Draw_Span_Load_Diag_Button.Value;

if (State.Draw_Span_Load_Diag_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Span_Load_Diag_Button';
    GW_Plot_Erase_Diagrams(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Span_Load_Diag_Button';
    GW_Plot_Erase_Diagrams(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

Draw_Pressure_Diag_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Pressure_Diag_Button');

State.Draw_Pressure_Diag_Button = Draw_Pressure_Diag_Button.Value;

if (State.Draw_Pressure_Diag_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Pressure_Diag_Button';
    GW_Plot_Erase_Diagrams(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Pressure_Diag_Button';
    GW_Plot_Erase_Diagrams(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

Button_Handle = findall(Graphic_Window_Handle, 'Tag', 'Draw_Pressure_Center_Button');

if (strcmp(Button_Handle.Enable, 'on'))
    
    Draw_Pressure_Center_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Pressure_Center_Button');
    Label_Pressure_Center_Button = findall(Graphic_Window_Handle, 'Tag', 'Label_Pressure_Center_Button');
    Pressure_Center_Coord_Button = findall(Graphic_Window_Handle, 'Tag', 'Pressure_Center_Coord_Button');
    Pressure_Center_Param_Coord_Button = findall(Graphic_Window_Handle, 'Tag', 'Pressure_Center_Param_Coord_Button');

    State.Draw_Pressure_Center_Button = Draw_Pressure_Center_Button.Value;
    State.Label_Pressure_Center_Button = Label_Pressure_Center_Button.Value;
    State.Pressure_Center_Coord_Button = Pressure_Center_Coord_Button.Value;
    State.Pressure_Center_Param_Coord_Button = Pressure_Center_Param_Coord_Button.Value;

    if (State.Draw_Pressure_Center_Button == 1)

        tmp.Value = 0;
        tmp.Tag = 'Draw_Pressure_Center_Button';
        GW_Plot_Erase_Diagrams(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

        tmp.Value = 1;
        tmp.Tag = 'Draw_Pressure_Center_Button';
        GW_Plot_Erase_Diagrams(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

    end

    if (State.Label_Pressure_Center_Button == 1)

        tmp.Value = 1;
        tmp.Tag = 'Label_Pressure_Center_Button';
        GW_Plot_Erase_Diagrams(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

    end

    if (State.Pressure_Center_Coord_Button == 1)

        tmp.Value = 1;
        tmp.Tag = 'Pressure_Center_Coord_Button';
        GW_Plot_Erase_Diagrams(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

    end

    if (State.Pressure_Center_Param_Coord_Button == 1)

        tmp.Value = 1;
        tmp.Tag = 'Pressure_Center_Param_Coord_Button';
        GW_Plot_Erase_Diagrams(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

    end
    
end

Draw_Pressure_Centers_Line_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Pressure_Centers_Line_Button');

State.Draw_Pressure_Centers_Line_Button = Draw_Pressure_Centers_Line_Button.Value;

if (State.Draw_Pressure_Centers_Line_Button == 1)
    
    tmp.Value = 0;
    tmp.Tag = 'Draw_Pressure_Centers_Line_Button';
    GW_Plot_Erase_Diagrams(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
    
    tmp.Value = 1;
    tmp.Tag = 'Draw_Pressure_Centers_Line_Button';
    GW_Plot_Erase_Diagrams(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
    
end

% ================== Результирующие ==================

Draw_Summation_Point_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Summation_Point_Button');
Label_Summation_Point_Button = findall(Graphic_Window_Handle, 'Tag', 'Label_Summation_Point_Button');
Summation_Point_Coord_Button = findall(Graphic_Window_Handle, 'Tag', 'Summation_Point_Coord_Button');

State.Draw_Summation_Point_Button = Draw_Summation_Point_Button.Value;
State.Label_Summation_Point_Button = Label_Summation_Point_Button.Value;
State.Summation_Point_Coord_Button = Summation_Point_Coord_Button.Value;

if (State.Draw_Summation_Point_Button == 1)

    tmp.Value = 0;
    tmp.Tag = 'Draw_Summation_Point_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

    tmp.Value = 1;
    tmp.Tag = 'Draw_Summation_Point_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

if (State.Label_Summation_Point_Button == 1)

    tmp.Value = 1;
    tmp.Tag = 'Label_Summation_Point_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

if (State.Summation_Point_Coord_Button == 1)

    tmp.Value = 1;
    tmp.Tag = 'Summation_Point_Coord_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

Draw_Coord_System_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Coord_System_Button');

State.Draw_Coord_System_Button = Draw_Coord_System_Button.Value;

if (State.Draw_Coord_System_Button == 1)

    tmp.Value = 0;
    tmp.Tag = 'Draw_Coord_System_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

    tmp.Value = 1;
    tmp.Tag = 'Draw_Coord_System_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

Draw_Force_Resultant_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Force_Resultant_Button');

State.Draw_Force_Resultant_Button = Draw_Force_Resultant_Button.Value;

if (State.Draw_Force_Resultant_Button == 1)

    tmp.Value = 0;
    tmp.Tag = 'Draw_Force_Resultant_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

    tmp.Value = 1;
    tmp.Tag = 'Draw_Force_Resultant_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

Draw_Force_Pn_Pt_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Force_Pn_Pt_Button');

State.Draw_Force_Pn_Pt_Button = Draw_Force_Pn_Pt_Button.Value;

if (State.Draw_Force_Pn_Pt_Button == 1)

    tmp.Value = 0;
    tmp.Tag = 'Draw_Force_Pn_Pt_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

    tmp.Value = 1;
    tmp.Tag = 'Draw_Force_Pn_Pt_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

Draw_Force_XYZ_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Force_XYZ_Button');

State.Draw_Force_XYZ_Button = Draw_Force_XYZ_Button.Value;

if (State.Draw_Force_XYZ_Button == 1)

    tmp.Value = 0;
    tmp.Tag = 'Draw_Force_XYZ_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

    tmp.Value = 1;
    tmp.Tag = 'Draw_Force_XYZ_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

Draw_Moment_Resultant_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Moment_Resultant_Button');

State.Draw_Moment_Resultant_Button = Draw_Moment_Resultant_Button.Value;

if (State.Draw_Moment_Resultant_Button == 1)

    tmp.Value = 0;
    tmp.Tag = 'Draw_Moment_Resultant_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

    tmp.Value = 1;
    tmp.Tag = 'Draw_Moment_Resultant_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

Draw_Moment_XYZ_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Moment_XYZ_Button');

State.Draw_Moment_XYZ_Button = Draw_Moment_XYZ_Button.Value;

if (State.Draw_Moment_XYZ_Button == 1)

    tmp.Value = 0;
    tmp.Tag = 'Draw_Moment_XYZ_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

    tmp.Value = 1;
    tmp.Tag = 'Draw_Moment_XYZ_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

Draw_Actual_Pressure_Center_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Actual_Pressure_Center_Button');
Label_Actual_Pressure_Center_Button = findall(Graphic_Window_Handle, 'Tag', 'Label_Actual_Pressure_Center_Button');
Actual_Pressure_Center_Coord_Button = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Coord_Button');
Actual_Pressure_Center_Param_Coord_Button = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Param_Coord_Button');

State.Draw_Actual_Pressure_Center_Button = Draw_Actual_Pressure_Center_Button.Value;
State.Label_Actual_Pressure_Center_Button = Label_Actual_Pressure_Center_Button.Value;
State.Actual_Pressure_Center_Coord_Button = Actual_Pressure_Center_Coord_Button.Value;
State.Actual_Pressure_Center_Param_Coord_Button = Actual_Pressure_Center_Param_Coord_Button.Value;

if (State.Draw_Actual_Pressure_Center_Button == 1)

    tmp.Value = 0;
    tmp.Tag = 'Draw_Actual_Pressure_Center_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

    tmp.Value = 1;
    tmp.Tag = 'Draw_Actual_Pressure_Center_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

if (State.Label_Actual_Pressure_Center_Button == 1)

    tmp.Value = 1;
    tmp.Tag = 'Label_Actual_Pressure_Center_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

if (State.Actual_Pressure_Center_Coord_Button == 1)

    tmp.Value = 1;
    tmp.Tag = 'Actual_Pressure_Center_Coord_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

if (State.Actual_Pressure_Center_Param_Coord_Button == 1)

    tmp.Value = 1;
    tmp.Tag = 'Actual_Pressure_Center_Param_Coord_Button';
    GW_Plot_Erase_Resultants(tmp,[]);
    set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

end

% ================== Поля ==================

switch Graphics.Load.Distributed_Load_Mode

    case 'CID_DISTR_LOAD'

        Draw_CID_Distr_Load_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_CID_Distr_Load_Button');

        State.Draw_CID_Distr_Load_Button = Draw_CID_Distr_Load_Button.Value;

        if (State.Draw_CID_Distr_Load_Button == 1)

            tmp.Value = 0;
            tmp.Tag = 'Draw_CID_Distr_Load_Button';
            GW_Plot_Erase_Fields(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

            tmp.Value = 1;
            tmp.Tag = 'Draw_CID_Distr_Load_Button';
            GW_Plot_Erase_Fields(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

        end

    case 'PRESSURE'

        Draw_Pressure_Field_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Pressure_Field_Button');

        State.Draw_Pressure_Field_Button = Draw_Pressure_Field_Button.Value;

        if (State.Draw_Pressure_Field_Button == 1)

            tmp.Value = 0;
            tmp.Tag = 'Draw_Pressure_Field_Button';
            GW_Plot_Erase_Fields(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

            tmp.Value = 1;
            tmp.Tag = 'Draw_Pressure_Field_Button';
            GW_Plot_Erase_Fields(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

        end
        
        Draw_Pressure_Pn_Pt_Button = findall(Graphic_Window_Handle, 'Tag', 'Draw_Pressure_Pn_Pt_Button');

        State.Draw_Pressure_Pn_Pt_Button = Draw_Pressure_Pn_Pt_Button.Value;

        if (State.Draw_Pressure_Pn_Pt_Button == 1)

            tmp.Value = 0;
            tmp.Tag = 'Draw_Pressure_Pn_Pt_Button';
            GW_Plot_Erase_Fields(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

            tmp.Value = 1;
            tmp.Tag = 'Draw_Pressure_Pn_Pt_Button';
            GW_Plot_Erase_Fields(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);

        end

end

% ================== Скрытая линия ==================

Projected_Chord_Surf_Boundary = [Graphics.Load.Chord_Surface.A1_projected, ...
                                 Graphics.Load.Chord_Surface.A2_projected, ...
                                 Graphics.Load.Chord_Surface.A4_projected, ...
                                 Graphics.Load.Chord_Surface.A3_projected, ...
                                 Graphics.Load.Chord_Surface.A1_projected];

Hidden_Line = findall(Graphic_Window_Handle, 'Tag', 'Hidden_Line');

set(Hidden_Line, 'XData', Projected_Chord_Surf_Boundary(1,:));
set(Hidden_Line, 'YData', Projected_Chord_Surf_Boundary(2,:));
set(Hidden_Line, 'ZData', Projected_Chord_Surf_Boundary(3,:));
